<?php
/**
 * Bild the additional fields to Languages table 
 */
class Languages_Row extends Zend_Db_Table_Row_Abstract
{
    public $langI18n = null;
    
    public function init()
    {
    	$locale = Zend_Registry::get('Zend_Locale');

    	// $langTranslation = $locale->getLanguageTranslation($this->iso_639_1_code);
    	// BUG FIX: found a bug in Zend_Locale->getLanguageTranslation()
    	// It doesn't use the default locale so we need to provide locale now
        $langTranslation = $locale->getLanguageTranslation($this->iso_639_1_code, $locale);

        $this->langI18n = ($langTranslation ? mb_ucfirst($langTranslation) : $this->title_latin);
    }
}